package create.abstract_factory;

/**
 * @author houkai
 * 接口是负责创建一个相关对象的工厂，不需要显式指定它们的类。每个生成的工厂都能按照工厂模式提供对象。
 */
public class AbstractFactoryPatternDemo {
	
	public static void main(String[] args) {
		AbstractFactory afs = FactoryProducer.getFactory("shape");
		Shape square = afs.getShape("Square");
		square.draw();
		
		AbstractFactory afa = FactoryProducer.getFactory("animal");
		Animal dog = afa.getAnimal("dog");
		dog.breed();
	}
}
